]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
altTab: Support cycle-group cycling only over windows in the workspace
authorMitar <mitar.gnome@tnode.com>
Thu, 3 Sep 2020 07:51:44 +0000 (07:51 +0000)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 4 Sep 2020 17:48:33 +0000 (19:48 +0200)
This is consistent with the filtering done for switch-group when
org.gnome.shell.app-switcher current-workspace-only is set to true.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3116

js/ui/altTab.js

index 3937469b7c0478dd8844bb16d4b60e7729975df8..25683b55da48443a15171bcbfe3214861d10ac3e 100644 (file)
@@ -525,9 +525,23 @@ var CyclerPopup = GObject.registerClass({
 
 var GroupCyclerPopup = GObject.registerClass(
 class GroupCyclerPopup extends CyclerPopup {
+    _init() {
+        this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell.app-switcher' });
+        super._init();
+    }
+
     _getWindows() {
         let app = Shell.WindowTracker.get_default().focus_app;
-        return app ? app.get_windows() : [];
+        let appWindows = app ? app.get_windows() : [];
+
+        if (this._settings.get_boolean('current-workspace-only')) {
+            const workspaceManager = global.workspace_manager;
+            const workspace = workspaceManager.get_active_workspace();
+            appWindows = appWindows.filter(
+                window => window.located_on_workspace(workspace));
+        }
+
+        return appWindows;
     }
 
     _keyPressHandler(keysym, action) {